package com.ep.general.admin;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.ep.general.GeneralClassMdt;

public class AdministratorMdt extends GeneralClassMdt<Administrator> {

	public AdministratorMdt() {
		super(Administrator.class);
	}

	public Administrator get(String login, String haslo) {
		getSession().beginTransaction();
		Criteria crit = getSession().createCriteria(Administrator.class);
		crit.add(Restrictions.eq("login", login));
		crit.add(Restrictions.eq("haslo", haslo));

		return uniqueResult(crit);
	}
}
